package cn.java79.springcore.printer;

/**
 * @author oldliu
 * @since 1.0
 */
//打印机
public class Printer {
    //牌子
    private String brand;
    //价格
    private int money;

    private Ink ink;

    private TextPaper paper;

    public void print(String str){
        System.out.println("这个打印机"+brand+"价格是"+money+"元，启动了。。。");
        System.out.println("使用"+ink.getColor()+"的墨水来打印：");
        paper.print(str);
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public void setInk(Ink ink) {
        this.ink = ink;
    }

    public void setPaper(TextPaper paper) {
        this.paper = paper;
    }

    @Override
    public String toString() {
        return "Printer{" +
                "brand='" + brand + '\'' +
                ", money=" + money +
                ", ink=" + ink +
                ", paper=" + paper +
                '}';
    }
}
